package com.itheima;

public class WeatherNow {
    private String updateTime;
    private String temp;
    private String text;
    private String windDir;
    private String windSpeed;
    private String humidity;

    public WeatherNow(String updateTime, String temp, String text, String windDir, String windSpeed, String humidity) {
        this.updateTime = updateTime;
        this.temp = temp;
        this.text = text;
        this.windDir = windDir;
        this.windSpeed = windSpeed;
        this.humidity = humidity;
    }

    // Getters
    public String getUpdateTime() {
        return updateTime;
    }

    public String getTemp() {
        return temp;
    }

    public String getText() {
        return text;
    }

    public String getWindDir() {
        return windDir;
    }

    public String getWindSpeed() {
        return windSpeed;
    }

    public String getHumidity() {
        return humidity;
    }

    // 输出天气信息
    @Override
    public String toString() {
        return String.format("更新时间: %s\n温度: %s°C\n天气: %s\n风向: %s\n风速: %s km/h\n湿度: %s%%",
                updateTime, temp, text, windDir, windSpeed, humidity);
    }
}